<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <body></body>
</html>
<script>
    const regx = /^https?:\/\/www\.\w+\.(com|cn|net|org)$/i;
    const str1 = "https://www.baidu.com";
    const str2 = "https://google.com";
    console.log(regx.test(str1));
    console.log(regx.test(str2));
</script>
